package com.facebook.games.fa.util
{
	import mx.rpc.IResponder;
	
	/**
	 * Responder genérico
	 * @author Diego Maehler <dmaehler@gmail.com>
	 */
	public class Responder implements IResponder
	{
		
		private var resultHandler : Function;
		
		private var faultHandler : Function;
		
		/**
		 * 
		 */
		public function Responder(resultHandler : Function, faultHandler : Function)
		{
			this.resultHandler = resultHandler;
			this.faultHandler = faultHandler;
		}
		
		/**
		 * On Result
		 * @param
		 */
		public function result(data:Object):void
		{
			this.resultHandler(data);
		}
		
		/**
		 * On Fault
		 * @param
		 */
		public function fault(info:Object):void
		{
			this.faultHandler(info);
		}
		
	}
}